home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4974 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: rcp6.elan.af.mil!rscernix!danpop
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Limit on #bytes inside of struct?
  5. Date: 9 Feb 96 14:12:16 GMT
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <danpop.823875136@rscernix>
  8. References: <4feg1d$d4g@cville-srv.wam.umd.edu>
  9. NNTP-Posting-Host: ues5.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11.  
  12. In <4feg1d$d4g@cville-srv.wam.umd.edu> jsquires@wam.umd.edu (jeffrey d squires) writes:
  13.  
  14. >I have the following:
  15. >
  16. >typedef struct {
  17. >        int zero;
  18. >        int one;
  19. >        int two;
  20. >        int three;
  21. >        int four;
  22. >        int five;
  23. >        int six;
  24. >        int seven_or_more;
  25. >} hist_type;
  26. >
  27. >hist_type histogram;
  28. >int num=2;
  29. >
  30. >histogram.zero = 0;
  31. >histogram.one = 0;
  32. >histogram.two = 0;
  33. >histogram.three = 0;
  34. >histogram.four = 0;  /* at this point, value of num changes from 2 to 0!!!*/
  35. >
  36. >Is there a limit on the number of bytes allowed inside of a struct?
  37.  
  38. No.
  39.  
  40. >I am positive that the value of num changes from 2 before the last 
  41. >assignment to 0 after it.  Any ideas?  Is this a bug in gcc?  Unix?
  42.  
  43. Please post a _complete_ but minimal program which reproduces your 
  44. problem, mentioning your platform, so that we can have a look at it.
  45.  
  46. Dan
  47. --
  48. Dan Pop
  49. CERN, CN Division
  50. Email: danpop@mail.cern.ch 
  51. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  52.